const mongoose = require('mongoose');

const watchHistorySchema = new mongoose.Schema({
    user: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'User', // 关联到用户模型
        required: true,
    },
    card: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'Card', // 关联到卡片模型
        required: true,
    },
    timestamp: {
        type: Date,
        default: Date.now,
    },
});

const watchHistory = mongoose.model('watchHistory', watchHistorySchema);


module.exports = watchHistory;